# request API (HTTP::Request)

GET /bazra/xr1049?q=state&f=xml
Host: sharonb.reality-scada.net

# method, host, port, client name
req.method #=> :get
req.scheme #=> :http
req.ssl #=> false
req.host #=> sharonb.reality-scada.net
req.port #=> 80 (default?)
req.client_name #=> ...

# request URL
req.host_url #=> 'http://sharonb.reality-scada.net'
req.path_url #=> 'http://sharonb.reality-scada.net/bazra/xr1049'
req.url #=> 'http://sharonb.reality-scada.net/bazra/xr1049?q=state&f=xml'
req.path #=> "/bazra/xr1049"
req.path_qs #=> "/bazra/xr1049"
req.query_string #=> "q=state&f=xml"
req.params #=> {:q => "state", :f => "xml"}

# URL construction
req.host_relative_url('udim3') #=> 'http://sharonb.reality-scada.net/udim3'
req.host_relative_url('udim3', :pane => 'alarms') #=> "http://sharonb.reality-scada.net/udim3?pane=alarms"

# headers
req['Host'] #=> 'sharonb.reality-scada.net'
req.headers #=> {'Host' => 'sharonb.reality-scada.net'}

req.env['HOST'] #=> 'sharonb.reality-scada.net'

req.content_type #=> 'sharonb.reality-scada.net' (through method_missing)

# cookies
req.cookies #=> {:skey => '123156756709853453adf423'}

# request body
req.body #=> nil

# Accept header
Accept: text/html;q=0.5, application/xhtml+xml;q=1
req.accept_first_match('text/html', 'application/xhtml+xml') #=> 'text/html' (server preference)
req.accept_best_match('text/html', 'application/xhtml+xml') #=> 'application/xhtml+xml' (client preference)
req.accept_best_matches #=> ['application/xhtml+xml', 'text/html'] (client preferences in order)

# If-None-Match
req.if_none_match_valid?(etag) #=> true / false

# If-Modified-Since
req.if_modified_since_valid?(stamp) #=> true / false

# If-Match
req.if_match_valid?(etag) #=> true/false

